<template>
	<view class="menu-container">
		<navigator :url="`/cookbookPackage/pages/search/search?name=${item.name}`" v-for="item in menuData" :key="item._id">
			<view class="menu-item">
				<image :src="item.icon" mode=""></image>
				<text>{{ item.name }}</text>
			</view>
		</navigator>
	</view>
</template>

<script setup>
	import { ref } from 'vue';

	const menuData = ref([{
			"_id": "60e0146a1b3200002c006103",
			"icon": "https://woniumd.oss-cn-hangzhou.aliyuncs.com/web/zhaijizhe/20210804155537.png",
			"name": "家常菜",
			"navigateUrl": "/pages/search/search",
			"openType": "switchTab"
		},
		{
			"_id": "60e014821b3200002c006104",
			"name": "甜点",
			"icon": "https://woniumd.oss-cn-hangzhou.aliyuncs.com/web/zhaijizhe/20210804155656.png",
			"navigateUrl": "/pages/search/search",
			"openType": "switchTab"
		},
		{
			"_id": "60e014891b3200002c006105",
			"name": "素菜",
			"icon": "https://woniumd.oss-cn-hangzhou.aliyuncs.com/web/zhaijizhe/20210804155641.png",
			"navigateUrl": "/pages/search/search",
			"openType": "switchTab"
		},
		{
			"_id": "60e0149c1b3200002c006106",
			"name": "凉菜",
			"icon": "https://woniumd.oss-cn-hangzhou.aliyuncs.com/web/zhaijizhe/20210804155549.png",
			"navigateUrl": "/pages/search/search",
			"openType": "switchTab"
		},
		{
			"_id": "6106b38d0b2a000043001b73",
			"name": "下饭菜",
			"icon": "https://woniumd.oss-cn-hangzhou.aliyuncs.com/web/zhaijizhe/20210804155703.png",
			"navigateUrl": "/pages/search/search",
			"openType": "switchTab"
		},
		{
			"_id": "6106b4d00b2a000043001b74",
			"name": "川菜",
			"icon": "https://woniumd.oss-cn-hangzhou.aliyuncs.com/web/zhaijizhe/20210804155425.png",
			"navigateUrl": "/pages/search/search",
			"openType": "switchTab"
		},
		{
			"_id": "6106b4e30b2a000043001b75",
			"name": "面食",
			"icon": "https://woniumd.oss-cn-hangzhou.aliyuncs.com/web/zhaijizhe/20210804155627.png",
			"navigateUrl": "/pages/search/search",
			"openType": "switchTab"
		},
		{
			"_id": "6106b55e0b2a000043001b76",
			"name": "汤",
			"icon": "https://woniumd.oss-cn-hangzhou.aliyuncs.com/web/zhaijizhe/20210804155649.png",
			"navigateUrl": "/pages/search/search",
			"openType": "switchTab"
		},
		{
			"_id": "610a49d2a61d0000d1002902",
			"name": "清淡",
			"icon": "https://woniumd.oss-cn-hangzhou.aliyuncs.com/web/zhaijizhe/20210804155634.png",
			"navigateUrl": "/pages/search/search",
			"openType": "switchTab"
		},
		{
			"_id": "610a49f8a61d0000d1002903",
			"name": "分类",
			"icon": "https://woniumd.oss-cn-hangzhou.aliyuncs.com/web/zhaijizhe/20210804155508.png",
			"navigateUrl": "/pages/category/category",
			"openType": "switchTab"
		}
	]);
</script>

<style scoped lang="scss">
	.menu-container {
		display: grid;
		grid-template-columns: 1fr 1fr 1fr 1fr 1fr;
		row-gap: 30rpx;

	}

	.menu-item {
		display: flex;
		flex-direction: column;
		align-items: center;

		image {
			width: 60rpx;
			height: 60rpx;
		}

		text {
			font-size: 22rpx;
		}
	}
</style>